package com.zyd.shiro.business.enums;

/**
 * @Classname RespCode
 * @Description TODO
 * @Date 2020/6/14 8:14
 * @Created by King
 */
public enum CompScale {
    MIN(1, "微型"),
    SMALL(2, "小型"),
    MID(3, "中型"),
    LAGRE(4, "大型");

    private Integer code;
    private String msg;

    CompScale(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMsgByCode(int code) {
        for (CompScale compScale : CompScale.values()) {
            if (compScale.getCode() == code) {
                return compScale.getMsg();
            }
        }
        return "未知";
    }
}
